The TabControl control is a container control that allows you to display multiple tab on a single form and it allowed switching between the tabs.
How to use TabControl
Drag and drop TabControl from Toolbox on the window Form.
Change header text of TabPages
Example:
privatevoid frmTabControl_Load(object sender, EventArgs e)
{
// Header text of TabPage1 will be chnage
tabPage1.Text = "Email id";
// Header text of TabPage2 will be chnage
tabPage2.Text = "Language";
}
When you run the project then Header Text of TabPages will be changed.
Other control can be place in TabPages.
When you click LangaugeTab then Language TabPage will open.
Add tab pages in TabControl
Example:
privatevoid frmTabControl_Load(object sender, EventArgs e)
{
// add new tab page in tabcontrol
tabControl1.TabPages.Add("Database");
}
When you execute the application then new TabPage will be add.
New TabPage with name Database is added.
TabControl properties
ItemSize: Gets or sets the size of the control's tabs.
TabStop: Gets or sets a value indicating whether the user can give the focus to this control using the TAB key.
Visible: Gets or sets a value indicating whether the control and all its child controls are displayed.
TabCount: The number of tabs in the tab strip.
Anonymous User
05-Mar-2019Thank You.